package com.platform.study.thread;

/**
 * 用继承Thread方式实现线程
 * User: wangyanginfo
 * Date: 12-11-23
 * Time: 下午5:31
 */
public class ThreadSimple extends Thread {

    private String name;

    public ThreadSimple(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 500; i++) {
            System.out.println(Thread.currentThread().getName()
                    + " 运行 " + name + "  _  " + i);
        }
    }

    public static void main(String[] args) {
        ThreadSimple simpleA = new ThreadSimple("A");
        ThreadSimple simpleB = new ThreadSimple("B");
        simpleA.start();
        simpleB.start();
    }
}
